#pragma once
#include<pthread.h>
namespace my_mutex
{
    class mymutex
    {
    public:
        mymutex()
        {
            pthread_mutex_init(&_mutex,nullptr);
        }
        void lock()
        {
            pthread_mutex_lock(&_mutex);
        }
        void unlock()
        {
            pthread_mutex_unlock(&_mutex);
        }
        ~mymutex()
        {
            pthread_mutex_destroy(&_mutex);
        }
    private:
        pthread_mutex_t _mutex;
    };
}